/**
 * 管理员侧边栏
 * @author 韩睿倩
 */
<template>
  <div>
    <el-menu default-active="1-4-1" class="el-menu-vertical-demo" background-color="#545c64" text-color="#fff"
      active-text-color="#ffd04d" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
      <h3>{{ isCollapse ? '后台' : '自家用英语学习平台' }}</h3>
      <h3>{{ isCollapse ? '' : '后台管理系统' }}</h3>
      <el-submenu index="1">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span slot="title">基础功能</span>
        </template>
        <el-menu-item index="1-1" @click="userManagement">用户管理</el-menu-item>
        <el-menu-item index="1-2" @click="functionManagement">功能管理</el-menu-item>
        <el-menu-item index="1-3" @click="thesaurusModule">词库模块</el-menu-item>
      </el-submenu>
      <el-menu-item index="2">
        <i class="el-icon-menu"></i>
        <span slot="title" @click="handleRouterBooklet">单词本模块</span>
      </el-menu-item>
      <el-menu-item index="3">
        <i class="el-icon-document"></i>
        <span slot="title" @click="handleRouterDictionary">词典模块</span>
      </el-menu-item>
      <el-menu-item index="4">
        <i class="el-icon-setting"></i>
        <span slot="title" @click="socialManagement">社交管理模块</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {

    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    userManagement() {
      this.$router.push('/administratorHome/userManagement')
    },
    functionManagement() {
      this.$router.push('/administratorHome/functionManagement')
    },
    thesaurusModule() {
      this.$router.push('/administratorHome/thesaurusModule')
    },
    socialManagement() {
      this.$router.push('/administratorHome/socialManagement')
    },
    handleRouterBooklet() {
      // window.location.href = '/userHome/booklets'
      this.$router.push('/administratorHome/booklets')
    },
    handleRouterDictionary() {
      this.$router.push('/administratorHome')
    },



  },
  computed: {
    isCollapse() {
      return this.$store.getters.isCollapse
    }
  }
};
</script>

<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  /* display:flex; */
  width: 300px;
  min-height: 400px;
  font-size: 20px;
}

.el-menu {
  display: flex;
  flex-direction: column;
  height: 100vh;
  border: none;


}

.el-menu h3 {
  color: white;
  text-align: center;
  line-height: 20px;
  font-size: 18px;
    /* margin-left: 50px; */
}

/* .span {
  font-size: 18px;
}
.el-submenu{
   font-size: 18px;
} */





</style>

<style lang="scss">
.el-submenu__title {
  font-size: 18px;
  color: #303133;
  padding: 0 20px;
  cursor: pointer;
  transition: border-color .3s, background-color .3s, color .3s;
  box-sizing: border-box;
}

.el-menu-item {
  font-size: 18px;
  color: #303133;
  padding: 0 20px;
  cursor: pointer;
  transition: border-color .3s, background-color .3s, color .3s;
  box-sizing: border-box;
}
</style>